<?php

/*
 * This file is part of the FOSUserBundle package.
 *
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Lettral\UserBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use FOS\UserBundle\Form\Type\ProfileFormType;

class UserProfileForm extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('email', 'email', array('label' => 'Email :', 'required' => true))
            //->add('currentPassword', 'password', array('label' => 'Ancien mot de passe :', 'required' => false))
            ->add('plainPassword', 'repeated', array('type' => 'password', 'first_name' => 'Mot de passe :', 'second_name' => 'Confirmation :', 'required' => false))
            ->add('civilite', 'choice', array('choices' => array('M' => 'M.', 'Mme' => 'Mme.', 'Mlle' => 'Mlle.'), 'label' => 'Civilité :', 'required' => true))
            ->add('nom', 'text', array('label' => 'Nom :', 'required' => true))
            ->add('prenom', 'text', array('label' => 'Prénom :', 'required' => true))
            ->add('adresse', 'text', array('label' => 'Adresse :', 'max_length' => 150, 'required' => true))
            ->add('comp', 'text', array('label' => 'Complément d\'adresse :', 'required' => false, 'max_length' => 150))
            ->add('cp', 'text', array('label' => 'Code postal :', 'max_length' => 6, 'required' => true))
            ->add('ville', 'text', array('label' => 'Ville :', 'required' => true))
            ->add('fixe', 'text', array('label' => 'Téléphone fixe :', 'max_length' => 14, 'required' => false))
            ->add('port', 'text', array('label' => 'Mobile :', 'max_length' => 14, 'required' => false))
        	->add('displayEmail', 'email', array('label' => 'Email :', 'required' => false));
    }
    
    public function getName()
    {
    	return 'lettral_user_profile';
    }
}
